
<center><div style="height:35px;"><div id="message">&nbsp;</div></div></center>
<?php if($this->Session->read('message')){
	echo '<script>showMessage("mainContent","'.$this->Session->read('message').'");</script>';
	$this->Session->delete('message');	
	}?>
<?php if($this->Session->read('error')){
	echo '<script>showMessage("mainContent","'.$this->Session->read('error').'",1);</script>';
	$this->Session->delete('error');
}?>
	<form id="listForm" name="listForm" method="get" action="#">
    <table class="list">
      <tbody>
      <tr>
      
		<th align="left" width="15px">#</th>
        <th align="left"><?php echo $this->Common->columnTitle(_resource('name',true),$uses[0].'.name')?></th>
        <th align="left"><?php echo $this->Common->columnTitle(_resource('url',true),$uses[0].'.url')?></th>
        <th align="left"><?php echo $this->Common->columnTitle(_resource('username',true),$uses[0].'.username')?></th>
        <th align="center" width="60px"><?php echo $this->Common->columnTitle(_resource('active',true),$uses[0].'.active')?></th>                           
		<th align="center" width="100px"><?php _resource('task');?></th>              
      </tr>
		<?php
			if(count($data0)>0){
			foreach($data0 as $k=>$v){
		?>
      <tr class="row<?php echo fmod($k,2)+1;?>" onmouseout="this.className='row<?php echo fmod($k,2)+1;?>'" onmouseover="this.className='highlight'">

      	<td align="left">
      		<input class="checkbox" type="checkbox" id="cb" name="check[<?php echo $v[$uses[0]]['id'];?>]"/>
      	</td>

      	
      	
       <td align="left">        
        	<a href="javascript:;" onclick="ajax('addContent','<?php echo $this->params['controller'].'/edit/'.$v[$uses[0]]['id'];?>');"><?php echo $v[$uses[0]]['name'];?></a>
        </td>
        <td align="left">        
        	<a href="<?php echo $v[$uses[0]]['url'];?>" target="_blank"><?php echo $v[$uses[0]]['url'];?></a>
        </td>
        <td align="left">
        
        	<?php echo $v[$uses[0]]['username'];?>
        </td>        
	      
     	<td align="center">
     		<?php if($v[$uses[0]]['active']){?>
     		<img src="<?php echo $this->webroot.'img/backend/tick.png'?>" width="16" height="16" border="0" alt="default" />
     		<?php }
     		else{?>
     			<a href="javascript:;"> <img src="<?php echo $this->webroot.'img/backend/publish_x.png'?>" width="16" height="16" border="0" alt="default" onclick="ajax('listContent','<?php echo $this->params['controller']?>/changeActive/<?php echo $v[$uses[0]]['id']?>');" /></a>
    
     		<?php }
     		?>
     	</td>
     	
		<td align="center">
			
			<span title="<?php _resource('edit');?>"><a href="javascript:;" onclick="ajax('addContent','<?php echo $this->params['controller']?>/edit/<?php echo $v[$uses[0]]['id'];?>');"> <img border="0" src="<?php echo $this->webroot; ?>img/backend/icon-16-edit.png"/></a></span>
			
			<span title="<?php _resource('delete');?>"><a href="javascript:;" onclick="ajaxSubmit('listContent','<?php echo $this->params['controller']?>/delete/<?php echo $v[$uses[0]]['id'];?>','deleteone','',true);return false;"> <img border="0" src="<?php echo $this->webroot; ?>img/backend/icon-16-trash.png"/></a></span>
			
		</td>              
        
      </tr>
      <?php } ?>
      <?php } ?>
      
          </tbody>
      </table>
</form>
<script>
	setTimeout("removeMessage()",5000);	
</script>
<div class="pagination">
                <span><?php _resource('display') ?> #
                  <select name="limit" id="limit" class="inputbox" size="1" onchange="ajax('listContent','<?php echo $this->params['controller']?>/display/'+this.value);">
                    <?php 
							for($i=1;$i<10;$i++){
								$v=$i*$webConfig['default_row_per_page'];
								$select=($this->Session->read($uses[0].'.limit')==$v)?'selected="selected"':'';
								echo '<option value="'.$v.'" '.$select.' >'.$v.'</option>';
							}
						?>
                  </select>
                </span>
                <!-- Button prev -->
           
                <?php
                	$paging=$this->Paginator->getPages(); 
							if(isset($paging['prev'])){
								echo $paging['prev'];
							}
							
							
						?>
                <!-- end Button prev -->
                
                    <?php
                    	echo $paging['paging'];
					?>
                  
                <!-- Button next -->
                
                <?php 
							if(isset($paging['next'])){
								echo $paging['next'];
							}
							
						?>
                <!-- end Button next -->
                <span>
                  <?php if(!empty($paging['cboPaging'])){
								echo _resource('goto',true).' # '.$paging['cboPaging'];
							}?>
                </span>
                <span>
                  <?php
								if($paging['totalPage']>0){
								?>
                  Page <?php echo $paging['currentPage']?>/<?php echo $paging['totalPage']?> </span>
                <?php
								}
								?>
                
</div>
